/*
 * File: Episode.java
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package tvseries.entity;

import java.io.Serializable;

/**
 * DAO object for episodes.
 * 
 * @author nish.naidoo@gmail.com
 * 
 */
public class Episode implements Comparable<Episode>, Serializable
{
	private static final long serialVersionUID = 8342105650813612417L;

	private String id = null;
	private int season = -1;
	private int episode = -1;
	private String title = null;
	private String imdbUrl = null;
	private String airDate = null;
	private String summary = null;
	private String releaseYear = null;
	private String status = null;

	private Series series = null;

	/**
	 * @return the season
	 */
	public int getSeason()
	{
		return season;
	}

	/**
	 * @param season the season to set
	 */
	public void setSeason(int season)
	{
		this.season = season;
	}

	/**
	 * @return the episode
	 */
	public int getEpisode()
	{
		return episode;
	}

	/**
	 * @param episode the episode to set
	 */
	public void setEpisode(int episode)
	{
		this.episode = episode;
	}

	/**
	 * @return the title
	 */
	public String getTitle()
	{
		return title;
	}

	/**
	 * @param title the title to set
	 */
	public void setTitle(String title)
	{
		this.title = title;
	}

	/**
	 * @return the imdbUrl
	 */
	public String getImdbUrl()
	{
		return imdbUrl;
	}

	/**
	 * @param imdbUrl the imdbUrl to set
	 */
	public void setImdbUrl(String imdbUrl)
	{
		this.imdbUrl = imdbUrl;
	}

	/**
	 * @return the airDate
	 */
	public String getAirDate()
	{
		return airDate;
	}

	/**
	 * @param airDate the airDate to set
	 */
	public void setAirDate(String airDate)
	{
		this.airDate = airDate;
	}

	/**
	 * @return the summary
	 */
	public String getSummary()
	{
		return summary;
	}

	/**
	 * @param summary the summary to set
	 */
	public void setSummary(String summary)
	{
		this.summary = summary;
	}

	/**
	 * @return the id
	 */
	public String getId()
	{
		return id;
	}

	/**
	 * @param id the id to set
	 */
	public void setId(String id)
	{
		this.id = id;
	}

	/**
	 * @return the releaseYear
	 */
	public String getReleaseYear()
	{
		return releaseYear;
	}

	/**
	 * @param releaseYear the releaseYear to set
	 */
	public void setReleaseYear(String releaseYear)
	{
		this.releaseYear = releaseYear;
	}

	/**
	 * @return the status
	 */
	public String getStatus()
	{
		return status;
	}

	/**
	 * @param status the status to set
	 */
	public void setStatus(String status)
	{
		this.status = status;
	}

	/**
	 * @return the series
	 */
	public Series getSeries()
	{
		return series;
	}

	/**
	 * @param series the series to set
	 */
	public void setSeries(Series series)
	{
		this.series = series;
	}

	public int compareTo(Episode e)
	{
		if (this.getSeason() - e.getSeason() != 0)
			return this.getSeason() - e.getSeason();

		return this.getEpisode() - e.getEpisode();
	}
}
